/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.conexaoBanco;

import javax.faces.bean.ApplicationScoped;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author Alessandro
 */
@ApplicationScoped
public class ConexaoJPA {

    private static EntityManagerFactory emf;

    static {
        emf = Persistence.createEntityManagerFactory("pessoaPU");
    }

    public static EntityManager getEntityManager() {
        return emf.createEntityManager();
    }
}
